{**
 * SDTT.tpl: hien thi cho xem cac tai khoan trong DMuc
 *
 * Copyright (c) 2003-2012 John Willinsky
 * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
 *
 * Display list of sections in journal management.
 *{include file="common/header.tpl"}
 * <tr valign="top">
	<td width="20%" class="label"><label for="mant">Lo&#7841;i ti&#7873;n:*</label></td>
	<td width="30%" class="value"><input type="text" style="text-transform:uppercase;" name="mant" value="{$loaitien}" id="mant" onkeyup="ShowHint(this.value, '{$dmnts}', 'txtHintMANT', 'mant', '</br>')" onblur="ExitMa(this.id,'txtHintMANT', '{$dmnts}')" onfocus="EntertMa(this.id,'txtHintMANT', '{$dmnts}')" size="15" maxlength="120" class="textField" /></td>
	<td width="40%" class="value"><div id="txtHintMANT"></div></td>
</tr>
<div id="div1" style="margin: 0 auto; border:1px solid black;background-color:Beige ;">
<link href='http://fonts.googleapis.com/css?family=ABeeZee' rel='stylesheet' type='text/css'>
 *
 * $Id$
 *}


 <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset={$defaultCharset|escape}" />
	<link rel="stylesheet" href="{$baseUrl}/lib/pkp/styles/pkp.css" type="text/css" />
	

	<link rel="stylesheet" href="{$baseUrl}/lib/pkp/styles/common.css" type="text/css" />
	<link rel="stylesheet" href="{$baseUrl}/styles/common.css" type="text/css" />

	<!-- Base Jquery -->
	{*
	{if $allowCDN}<script type="text/javascript" src="http://www.google.com/jsapi"></script>
	<script type="text/javascript">{literal}
		// Provide a local fallback if the CDN cannot be reached
		if (typeof google == 'undefined') {
			document.write(unescape("%3Cscript src='{/literal}{$baseUrl}{literal}/lib/pkp/js/lib/jquery/jquery.min.js' type='text/javascript'%3E%3C/script%3E"));
			document.write(unescape("%3Cscript src='{/literal}{$baseUrl}{literal}/lib/pkp/js/lib/jquery/plugins/jqueryUi.min.js' type='text/javascript'%3E%3C/script%3E"));
		} else {
			google.load("jquery", "{/literal}{$smarty.const.CDN_JQUERY_VERSION}{literal}");
			google.load("jqueryui", "{/literal}{$smarty.const.CDN_JQUERY_UI_VERSION}{literal}");
		}
	{/literal}</script>
	{else}
	*}
	<script type="text/javascript" src="{$baseUrl}/lib/pkp/js/lib/jquery/jquery.min.js"></script>
	<script type="text/javascript" src="{$baseUrl}/lib/pkp/js/lib/jquery/plugins/jqueryUi.min.js"></script>
	{*{/if}
	*}

	<script type="text/javascript" src="{$baseUrl}/classes/acct/js/CNKTTH.js"></script>

</head>
{*
<body onload='javascript:document.getElementById("soct").focus();'>
*}

{strip}
{assign var="pageTitle" value="Chung tu"}
{if ($loaitien) != 'VND' }
	{assign var="socot" value="6"}
{else}
	{assign var="socot" value="5"}
{/if}
<div id="header" >
<div id="headerTitle">
<h1  >

{if $displayPageHeaderLogo && is_array($displayPageHeaderLogo)}
	<img src="{$publicFilesDir}/{$displayPageHeaderLogo.uploadName|escape:"url"}" width="{$displayPageHeaderLogo.width|escape}" height="{$displayPageHeaderLogo.height|escape}" {if $displayPageHeaderLogoAltText != ''}alt="{$displayPageHeaderLogoAltText|escape}"{else}alt="{translate key="common.pageHeaderLogo.altText"}"{/if} />
{/if}
{if $displayPageHeaderTitle && is_array($displayPageHeaderTitle)}
	<img src="{$publicFilesDir}/{$displayPageHeaderTitle.uploadName|escape:"url"}" width="{$displayPageHeaderTitle.width|escape}" height="{$displayPageHeaderTitle.height|escape}" {if $displayPageHeaderTitleAltText != ''}alt="{$displayPageHeaderTitleAltText|escape}"{else}alt="{translate key="common.pageHeader.altText"}"{/if} />
{elseif $displayPageHeaderTitle}
	{$displayPageHeaderTitle}
{elseif $alternatePageHeader}
	{$alternatePageHeader}
{elseif $siteTitle}
	{$siteTitle}
{else}
	{$applicationName}
{/if}

</h1>
</div>
</div>
{include file="acct/acctNavbar.tpl"}
{include file="acct/breadcrumbs.tpl"}

{/strip}

{if ($Mode) == 'edit' }
	<body onload="LoadForm_edit('{$sodong}', '{$tknoss}', '{$tkcoss}', '{$macttknoss}', '{$macttkcoss}', '{$sotienvnss}','{$diengiaiss}', '{$urlS_getTenDMTK}', '{$urlS_getTenDMDV}')">
	{assign var="ngct" value=$ngct|date_format:"%d/%m/%Y"}

{else}
	<body onload="LoadForm_add({$sodong})">
	{assign var="ngct" value=$smarty.now|date_format:"%d/%m/%Y"}
{/if}



<div id = "ttChiTiet" style="display:none" >{$ChiTiet}</div>
<div id = "ttNam" style="display:none">{$xNam}</div>
<div id = "ttLoaiTien" style="display:none">{$loaitien}</div>

<div style="float: right;
	width: 19%;
	height: 100%;
	padding: 0em 0em 0em .5em ;
	font-size: 0.9em;
	height: 100%;
	margin: 0;">
{strip}
{include file="acctCN/RSBar.tpl"}
{/strip}

</div>

<div style="width: 80%">
<table id="head" width="100%">
<tr>
<th></th>
<th></th>
</tr>
<tr valign="bottom">
<td bgcolor='#ffffff' background='img/strichel.gif' colspan=2></td>
</tr>

<tr rowspan= "2" style="valign:top; margin-top:0">
	<td width="25%" valign="top" text-align= "center" rowspan = "2"><b>{$action}</b> <div id="idphieu" style="display:none"></div>
	<hr size="2" noshade style="color:#000000" align="left" />
	<input type="button" id="save" value="{translate key="common.save"}"  class="button" onClick="InsCT('close', '{$url}', '{$journalid}', '{$xNam}', '{$urlIns}', '{$urlMain}', '{$idphieu}');"> 
	
	
	{if isset($soct)}
		<input type="button" class="button" value="{translate key="common.cancel"}" class="button" onclick="refurl('{$urlMain}')" />
	{else}
		<input id="cancel" type="button" class="button" value="{translate key="common.cancel"}" class="button" />
	{/if}
	
	</td>

	<td width="75%"><div class="DMtitle" style = "valign: center; text-align: center; text-transform: uppercase "><strong>{$loaiphieu} <br> N. {$xNam}</strong></div></td>

</tr>
<tr valign="bottom">
<td bgcolor='#ffffff' background='img/strichel.gif' colspan=2></td>
</tr>
</table>
</div>



<form name="CTTMTG" id="CTTMTG" method="post" action="{url nam= $xNam  EditMode = "save" }" onsubmit="return false;">
<div style="width: 80%; border: thin solid #DDDDD0; border-left: none; background-color: 'ivory 3'  ">
<table id= "mymain"  width="100%" align = "left" cellspacing="0" >

<tr valign="top" height= "10px">
	<td width="10%" ></td>
	<td width="10%" ></td>
	<td width="5%" ></td>
	<td width="10%" ></td>
	<td width="10%"></td>
	<td width="10%"></td>
	<td width="10%"></td>
	<td width="10%"></td>
	<td width="10%"></td>
	<td width="10%"></td>
</tr>

<tr valign="center">
	<td colspan = "2"  align = "right"   class="mylabel" ><label for="soct">S&#7889; ch&#7913;ng t&#7915;:</label></td>
	<td colspan = "2" class="value" ><input type="text" name="soct" value="{$soct}" id="soct" style="width:70%" class="textField" /></td>

	<td colspan = "3"   align = "right"  class="mylabel"><label for="ngct">Ng&#224;y ch&#7913;ng t&#7915;:</label></td>
	<td colspan = "2" class="value"><input type="text" name="ngct" value="{$ngct}" id="ngct" size="10" maxlength="10"   onblur="return validNgay(this.value, this.id, '{$xNam}')" onkeydown="javascript:if (event.keyCode == 13) document.getElementById('hoten').focus()" class="textField" /></td>
	<td colspan = "1"></td>
</tr>
<tr valign="top">
	<td colspan = "2"  align = "right"   class="label"><label for="lydo">Nội dung:</label></td>
	<td colspan = "5" class="value"><input type="text" name="lydo" value="{$lydo}" id="lydo" class="textField" style="width:99%" /></td>
</tr>
<tr valign="top" height = "15px">
	
</tr>

</table>

{*
<table id = "action">
<td width = "20%">

<td width = "20%">
<td width = "40%">
<td width = "20%" align = "right"><input type="button" id="button_id" value="{translate key="common.save"}"  class="button defaultButton" onClick="InsCTTMTG('{$url}', '{$host}', '{$username}', '{$password}', '{$databaseName}', '{$journalid}', '{$xNam}', '{$loaitien}', '{$mact}', '{$noco}', '{$urlIns}');"> 
<input type="button" class="button defaultButton" value="{translate key="common.cancel"}" class="button" onclick="javascript:close_window();" /></td>
</table>
*}


<table id="myDetail" class = "listing" style="width: 100%; margin: 0 auto">
<thead>
<tr height = "40" class="myheaderrow">
<th width="5%" name="tkno" >TK Nợ</th>
<th width="10%" name="macttkno"  >Chi ti&#7871;t Nợ</th>
<th width="5%" name="tkco" >TK Có</th>
<th width="10%" name="macttkco"  >Chi ti&#7871;t Có</th>
<th width="7%" name="sotienvn" >S&#7889; t&#7873;n </th>
<th width="40%" name="diengiai"  >Di&#7877;n gi&#7843;i</th>
<th width="5%" name="BBB" align="right">{translate key="common.action"}</th>
	
</tr>
<tr >
</tr>
</thead>


<tr class="mydatarow" rowspan = "2">
<td class="value" style= "vertical-align: top;">
<select name="tkno" value="{$tkno0}" id="tkno-1" onclick="SetCur(this.id)"  onChange="changeMa(this.id, '{$urlS_getTenDMTK}');" class="selectMenu">
	{html_options options=$matka selected=$tkdu0}
</select>
<div  class="selectMenu" style="font-size:11px" ></div>
</td>

<td class="value" style= "vertical-align: top;">
<select name="macttkno-1" value="" id="macttkno-1"  onclick="SetCur(this.id)" onChange="changeMaCTTK(this.id, '{$urlS_getTenDMDV}');" class="selectMenu">
	{html_options options=$madva selected=""}
</select>
<div  class="selectMenu" style="font-size:11px" ></div>
</td>

<td class="value" style= "vertical-align: top;">
<select name="tkco" value="{$tkco0}" id="tkco-1" onclick="SetCur(this.id)"  onChange="changeMa(this.id, '{$urlS_getTenDMTK}');" class="selectMenu">
	{html_options options=$matka selected=$tkdu0}
</select>
<div  class="selectMenu" style="font-size:11px" ></div>
</td>

<td class="value" style= "vertical-align: top;">
<select name="macttkco-1" value="" id="macttkco-1"  onclick="SetCur(this.id)" onChange="changeMaCTTK(this.id, '{$urlS_getTenDMDV}');" class="selectMenu">
	{html_options options=$madva selected=""}
</select>
<div class="selectMenu" style="font-size:11px" ></div>
</td>


<td valign="top" class="value"><input type="text" name="sotienvn" value="" id="sotienvn-1" style="text-align:right"   onclick="SetCur(this.id)" onblur="return validSoTienVN(this.value, this.id,0)" onkeypress="return isNumberKey(event)" class="textField" /></td>

<td valign="top" class="value" ><input type="text" name="diengiai" value="" id="diengiai-1"  style="width:99%" onclick="SetCur(this.id)"  class="textField" /></td>

<td valign="top" id = 'mytd'>
<a class="actiondelrow" style="color: black;"  id = "rowdel-1" href="javascript:void(0);" onclick="delerow(this.id,2, -1,0);">-X&#243;a d&#242;ng</a>  
</td>

</tr>

</table>

<table id="myTotal" width = "95%"  style = "margin: 0 auto">
<tr height = "40" valign="center" >

{if ($loaitien) != 'VND' }
	<td width = "10%" style = "font-weight: bold; text-align:left; vertical-align: middle;">
	<a class="action" href="javascript:void(0);" onclick="tinhtongAll(null,2, 0,1,'');">+Tinh lai </a></td>
	<td width = "10%" style = "font-weight: bold; text-align:left; vertical-align: middle;">T&#7893;ng c&#7897;ng:</td>

	<td width = "20%" style = "font-weight: bold; vertical-align: middle;"><label id = "totalNT"></label><u>&nbsp &nbsp </u>{$loaitien}</td>
{else}
	<td width = "10%" style = "font-weight: bold; text-align:left; vertical-align: middle;" width = "10%">T&#7893;ng c&#7897;ng:</td>

{/if}

<td width = "20%" style = "font-weight: bold; vertical-align: middle;"  ><label id = "total"></label><u>&nbsp &nbsp </u>VND </td>
<td width = "20%" align = "right">
<a class="action" href="javascript:void(0);" onclick="addnewrow_add();">+Th&#234;m d&#242;ng</a> 
</td>
</td>
</tr>
</table>
</div>
</form>


</body>
</html>

	
